<%@ page language="java" import="java.util.*,cn.biwysh.exam.entity.User" pageEncoding="utf-8"%>
<%@page import="cn.biwysh.exam.entity.Exam"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
User user = null;
if (session.getAttribute("userqt") != null) {
	user = (User) session.getAttribute("userqt");
}else{
	response.sendRedirect("index.do");
}
List<Exam> nowlist=null;
if(request.getAttribute("nowlist")!=null){
	nowlist=(List<Exam>)request.getAttribute("nowlist");
}
List<Exam> oldlist=null;
if(request.getAttribute("oldlist")!=null){
	oldlist=(List<Exam>)request.getAttribute("oldlist");
}
String message=null;
if(request.getAttribute("message")!=null){
	message=request.getAttribute("message").toString();
}
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>考核系统</title>
    <link href="css/qt/mykh.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="script/jquery/jquery-1.5.1.min.js">
        </script>
    <script type="text/javascript">
	    $(function() {
	        if(!window.ActiveXObject){
	            $("#footht").css("height","20px");
	        }
	        initZYbg();
	        initTable();
	        <%if(message!=null){%>
	          alert( "<%=message%>");
	        <%}%>
	   	   	$(window).resize(function() {
			    initZYbg();
			   });
	    });
function initZYbg(){ 
	//alert($(document).width());
      if(document.body.clientWidth<957){
	        $("#mainleft").width(0);
	        $("#mainright").width(0);
	        $("#mainleft").css("display","none");
		    $("#mainright").css("display","none");
        }else{
	       if(!window.ActiveXObject){
		        var wid=($(document).width()-953)/2;
		        $("#mainleft").width(wid);
		        $("#mainright").width(wid);
		        $("#mainleft").css("display","block");
		        $("#mainright").css("display","block");
		    }else{
		        var wid=($(document).width()-974)/2;
		        if(wid>0){
		        	$("#mainleft").width(wid);
			        $("#mainright").width(wid);
			        $("#mainleft").css("display","block");
			        $("#mainright").css("display","block");
		        }
		    }
        }
}
	    function initTable(){
		    count=$("#nlist").find("tr").length;
		    if(count>4){
		    	 $("#nowlist").height(140+(count-4)*30);
			    }
		    oldcount=$("#olist").find("tr").length;
		     if(oldcount>10){
		    	 $("#oldlist").height(350+(oldcount-10)*30);
			    }
		    }
     </script>
  </head>
  
  <body>
    <div id="mainleft"><img src="img/qt/mainleft.jpg" style="width:100%;height:100%;"/></div>
     <div id="main">
      <div id="top">
            <jsp:include page="title.jsp" flush="true">
             <jsp:param name="jspName" value="mykh" />
           </jsp:include>
           <div class="clear"></div>
       </div>
       <div id="tgTXT">
           <div id="tiao" style=""></div>
           <div id="mainbg">
           <div style="height:40px;"> </div>
           <div id="nowlist">
             <table id="nlist" cellpadding="0" cellspacing="0">
                 <%if(nowlist!=null){
                	  for(int i=0;i<nowlist.size();i++){ %>
                		 <tr>
                		   <td style="width:450px;">
                		     <a href="dqkh.do?id=<%=nowlist.get(i).getId() %>"><%=nowlist.get(i).getName() %></a>（<%=nowlist.get(i).getStimestr() %>-<%=nowlist.get(i).getEtimestr() %>）
                		   </td>
                		   <td>
                		   <%if(!nowlist.get(i).isIsexamed()){%>
                			  <a href="goexam.do?id=<%=nowlist.get(i).getId() %>"><img src="img/qt/bi.jpg" style="border:0;"></img></a>
                		  <% } %>
                		   </td>
                	     </tr>
                 <%	  }
                	  if(nowlist.size()==0){%>
                		   <tr>
                		   <td style="width:450px;">
                		    当前没有正在进行的考核！
                		   </td>
                	     </tr>
                  <%	}
                  }%>
             </table>
           </div>
           <div id="dotline" style="border-bottom:dotted 1px #9E9E9E;width:900px;margin:0 auto;"></div>
           <div style="height:40px;clear:both;"> </div>
           <div id="oldlist">
             <table id="olist" cellpadding="0" cellspacing="0">
                <%if(oldlist!=null){
                	  for(int i=0;i<oldlist.size();i++){ %>
                		 <tr><td><a href="lskh.do?id=<%=oldlist.get(i).getId() %>"><%=oldlist.get(i).getName() %></a>（<%=oldlist.get(i).getStimestr() %>-<%=oldlist.get(i).getEtimestr() %>）</td> </tr>
                 <%	  }
                	  if(oldlist.size()==0){%>
                		 <tr>
                		   <td style="width:450px;">
                		    您还没参加过任何考核！
                		   </td>
                	     </tr>
                <%	  }
                  } %>
             </table>
           </div>
           </div>
           <div id="mainbottom"></div>
       </div>
      <div id="footht" style=""></div>
      <div id="footer">
		  <jsp:include page="footer.jsp" flush="true"></jsp:include>
	   </div>
     </div>
     <div id="mainright"><img src="img/qt/mainright.jpg" style="width:100%;height:100%;"/></div>
  </body>
 <SCRIPT LANGUAGE="JavaScript">   
		<!--   
	     //下面兼容ie6
	     var isIE = !!window.ActiveXObject;  
		 var isIE6 = isIE && !window.XMLHttpRequest; 
		  if(isIE){
			 $("#dotline").css("margin-left","20px");
		 }
		 if (isIE6) {  
	      $("#nlist").css("margin-left","120px");
	      $("#olist").css("margin-left","120px");
	      $("#dotline").css("margin-left","15px");
	    } 
		
		//-->   
</SCRIPT>
</html>
